﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.Generic;

namespace LightSwitchApplication.UserCode
{
    public class ReportHelper
    {
        private LightSwitchApplication.Screens.LSWReport lswReport;

        #region Contructor
        public ReportHelper()
        {
            
        }
        #endregion

        #region Method
        public void ShowReport(string ReportName)
        {
            Microsoft.LightSwitch.Threading.Dispatchers.Main.BeginInvoke(() =>
            {
                lswReport = new Screens.LSWReport();
                lswReport.Header = this.ReportTitle;
                lswReport.ReportName = ReportName;
                lswReport.Parameters = this.Parameters;

                lswReport.ShowDialog(); 
            });
        }
        #endregion

        #region Property
        private Dictionary<string, object> _Parameters = new Dictionary<string, object>();
        public Dictionary<string, object> Parameters { get { return _Parameters; } }

        public string ReportTitle { get; set; }
        #endregion
    }
}
